<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:c="http://java.sun.com/jsp/jstl/core"
		xmlns:p="http://primefaces.org/ui"
		xmlns:appcc="http://java.sun.com/jsf/composite/components"
		contentType="text/html" 
		local="${userContext.locale}">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${userContext.locale}" lang="${userContext.locale}">
	
	<h:head>
		<f:facet name="first">
			<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
			<title>#{messages['main.title']}</title>
		</f:facet>
		<f:facet name="last">
			<h:outputStylesheet name="css/main.css" />
			<h:outputStylesheet name="css/member.css" />
			<h:outputScript name="js/main.js" />
		</f:facet>
	</h:head>
	<h:body>
	
		<ui:insert name="popup"/>
		
		<img src="${request.contextPath}/resources/icons/environment/${systemProperties['env_name'] eq null ? 'development' : systemProperties['env_name']}.gif" width="58" height="50" class="versionEnv" alt="${systemProperties['env_name'] eq null ? 'development' : systemProperties['env_name']}"/> 
			<p:layout fullPage="true">
				<p:layoutUnit id="top" position="north" resizable="false" size="70" >
					<div role="banner" class="trjdk-main-banner">				
						<h:panelGrid columns="2" styleClass="trjdk-main-banner-content" columnClass="trjdk-main-banner-content-columun-logo, trjdk-main-banner-content-columun-other">
							<p:panel styleClass="trjdk-main-banner-content-logo">
								<a href="${request.contextPath}/home.faces">
									<img src="${request.contextPath}/resources/img/logo_fr.png" border="0" />
								</a>
							</p:panel>
							<p:panel styleClass="trjdk-main-banner-content-connection" id="loginPanel">
								<p:focus context="loginPanel"/>
								<h:panelGroup rendered="${userContext.isAnonymousUser()}">  
									<ui:include src="/WEB-INF/layouts/login.xhtml"/>
								</h:panelGroup>
								<h:panelGroup rendered="${userContext.isLoggedIn()}">  
									<!-- Log out -->
									<h:outputLink id="logout_link" value="${facesContext.externalContext.requestContextPath}/logout" 
										styleClass="trjdk-main-banner-content-connection-logout">
										<h:outputText value="${messages.logout}"/>
									</h:outputLink>
									<h:form>
										<!-- Submit a request -->
										<h:commandButton value="${messages['main.submit.request.button']}" 
											styleClass="trjdk-main-banner-content-subscription-button" style="float:right"
											action="#{submittingRequest.goSubmitRequest}" />
									</h:form>									
								</h:panelGroup>
							</p:panel>	
						</h:panelGrid>
					</div>
					<!-- <div role="navigation">
						toolbar
						<ui:insert name="toolbarChildren"/>		
					</div> -->
					<p:outputPanel rendered="#{readonly}">
							<!-- give focus to cancel to ease keyboard navigation -->
							<script type="text/javascript">
								$(function() {
									setTimeout(function() {
										APP.focusTo('form:cancel');
									}, 200);
								});
							</script>
					</p:outputPanel>
				</p:layoutUnit>

				<p:layoutUnit id="Bottom" position="south" resizable="false" size="55">	
					<div role="footer" class="trjdk-main-footer">
						<p:panel styleClass="trjdk-main-footer-link">
							<h:form id="trjdk-main-footer-link-form">
								<h:commandLink value="#{messages['main.footer.apropos']}"></h:commandLink> <p:spacer width="10" />
								<h:commandLink value="#{messages['main.footer.blog']}"></h:commandLink> <p:spacer width="10" />
								<h:commandLink value="#{messages['main.footer.suggestions']}"></h:commandLink> <p:spacer width="10" />
								<h:commandLink value="#{messages['main.footer.conditionsgenerales']}"></h:commandLink> <p:spacer width="10" />
								<h:commandLink value="#{messages['main.footer.contact']}"></h:commandLink> <p:spacer width="10" />
							</h:form>
						</p:panel>
					</div>
				</p:layoutUnit>
				
				<p:layoutUnit id="center" position="center" resizable="false" closable="false" collapsible="false">
					<p:panel styleClass="trjdk-main-content">
						<ui:insert name="content"/>
					</p:panel>
				</p:layoutUnit>
			</p:layout>
			<ui:insert name="dialogs"/>
			<script type="text/javascript">
				// example with asynchronous google analytics
				var _gaq = _gaq || [];
				_gaq.push([ '_setAccount', 'UA-166864-24' ]); // change with your google id
				_gaq.push([ '_setCustomVar', 1, 'rootPackage', 'jsf2Prime_com.omt.tarjimdinek', 1 ]); // example of user defined variable
				_gaq.push([ '_trackPageview' ]);
				(function() {
					var ga = document.createElement('script');
					ga.type = 'text/javascript';
					ga.async = true;
					ga.src = ('https:' == document.location.protocol ? 'https://ssl': 'http://www') + '.google-analytics.com/ga.js';
					var s = document.getElementsByTagName('script')[0];
					s.parentNode.insertBefore(ga, s);
				})();
			</script>
			
			<p:ajaxStatus style="width:64px;height:64px;position:fixed;right:5px;bottom:5px">  
			    <f:facet name="start">  
			        <p:graphicImage value="/images/loading.gif" />  
			    </f:facet>  
			  
			    <f:facet name="complete">  
			        <h:outputText value="" />  
			    </f:facet>  
			</p:ajaxStatus>  
	</h:body>
	</html>
</f:view>